package com.daikin.ktmustwrite.app

import androidx.multidex.MultiDex
import com.daikin.ktmustwrite.app.weight.loadCallBack.EmptyCallback
import com.daikin.ktmustwrite.app.weight.loadCallBack.ErrorCallback
import com.daikin.ktmustwrite.app.weight.loadCallBack.LoadingCallback
import com.kingja.loadsir.callback.SuccessCallback
import com.kingja.loadsir.core.LoadSir
import com.tencent.bugly.Bugly
import com.tencent.mmkv.MMKV
import me.hgj.jetpackmvvm.base.BaseApp


class APP : BaseApp() {

    companion object {
        lateinit var instance: APP
    }

    override fun onCreate() {
        super.onCreate()
        val context=applicationContext
        MultiDex.install(this)
        Bugly.init(context,"a52f2b5ebb",false)
        MMKV.initialize(this.filesDir.absolutePath+"/mmkv")

        //界面加载管理 初始化
        LoadSir.beginBuilder()
            .addCallback(LoadingCallback())//加载
            .addCallback(ErrorCallback())//错误
            .addCallback(EmptyCallback())//空
            .setDefaultCallback(SuccessCallback::class.java)//设置默认加载状态页
            .commit()
    }
}